package routers

import (
	"fanhantech.com/tagdata/controllers"
	"github.com/astaxie/beego"
)

func init() {
	beego.Router("/", &controllers.MainController{})

	beego.Router("/data", &controllers.DataController{})
	beego.Router("/data/project", &controllers.DataController{}, "get:GetProjectData")
	beego.Router("/data/commit", &controllers.DataController{}, "get:GetCommitData")
	beego.Router("/data/review", &controllers.DataController{}, "get:GetReviewData")

	beego.Router("/data/project/download", &controllers.DataController{}, "get:DownloadProjectData")
	beego.Router("/data/project/upload", &controllers.DataController{}, "post:UploadProjectData")

	beego.Router("/api/user", &controllers.UserController{}, "post:CreateUser")
	beego.Router("/api/user/:username", &controllers.UserController{}, "get:QueryUser")
	beego.Router("/api/user/:username/password", &controllers.UserController{}, "post:UpdatePassword")

	beego.Router("/api/user/rights", &controllers.UserRightController{}, "post:CreateUserRight")
	beego.Router("/api/user/:username/rights", &controllers.UserRightController{}, "get:QueryUserRight;post:UpdateUserRight")
	beego.Router("/api/project/:id/tasks", &controllers.TaskController{})
}
